package com.secondary.dao.main.impl;

import java.util.List;

import org.springframework.stereotype.Component;

import com.secondary.dao.BaseDao;
import com.secondary.dao.main.CategoryDao;
import com.secondary.pojos.Category;

@Component("categoryDao")
public class CategoryDaoImpl extends BaseDao implements CategoryDao {

	@Override
	public List<Category> findCategoriesByParentId(int id) {
		System.out.println(id);
		
		List<Category> list=getSession().createQuery("select new Category(id,name,picArea) from Category where super_category="+id).list();
		for(Category c:list){
			System.out.println("<><><><><><><"+c.getName()+"   "+c.getId());
		}
		return list;
	}
	
}
